********************************************************************************
*																			   *
*						Sir! I'd Rather Go to School Sir!					   *
*																			   *
*								 Mahdi Majbouri								   *
*																			   *
*									 Table B4								   *
*																			   *
*									6-6-2023								   *
*																			   *
********************************************************************************


********************
** Job Status
********************

use "census11-all.dta", clear

keep if fage>=fage18 & fage18>=threshold - 9 & fage18<=threshold + 10
keep if urban == 2

replace occ = . if occ>=998
gen job = int(occ/100) if occ>=100

*keep if age >= 22 & age <=28

/*
gen cskill = (job == 9)
replace cskill = 2 if inlist(job, 8, 7, 6, 5)
replace cskill = 3 if inlist(job, 3, 4)
replace cskill = 4 if job == 2
replace cskill = 4 if job == 1
replace cskill = . if job == . 
*/
gen cskill = inlist(job, 1, 2, 3, 4) if job !=.

gen s = (sons==1 & son==1) if sons!=.
replace s = . if relate == 3 & son == 0

gen st = s * t
gen sfa = s * fa
gen stfa = s * t * fa

gen sfasq = s * fasq
gen stfasq = s * t * fasq

gen sfacb = s * facb
gen stfacb = s * t * facb

gen dfa = sfa
replace dfa = 100 *fa if s == 0

drop if school == 1

gen agesq = age * age / 100

gen lfp = (empstat == 1 | empstat == 2)	if empstat != .	

reg lfp st t fa tfa s sfa ///
		stfa if relate==3 & son==1 & sons >= 1 ///
		& fage>=fage18 & urban == 2, vce(cluster fa)
outreg2 using "Table B4", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) ctitle("LFP(1)") replace
reg lfp st t fa tfa fasq tfasq s sfa ///
		stfa sfasq stfasq if relate==3 & son==1 & sons >= 1 ///
		& fage>=fage18 & urban == 2, vce(cluster fa)		
outreg2 using "Table B4", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) ctitle("LFP(2)") append
reg lfp st t fa tfa fasq tfasq facb tfacb s sfa ///
		stfa sfasq stfasq sfacb stfacb if relate==3 & son==1 & sons >= 1 ///
		& fage>=fage18 & urban == 2, vce(cluster fa)		
outreg2 using "Table B4", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) ctitle("LFP(3)") append
		
gen unemployed = (empstat == 2) if lfp == 1		
reg unemployed st t fa tfa s sfa ///
		stfa if relate==3 & son==1 & sons >= 1 ///
		& fage>=fage18 & urban == 2, vce(cluster fa)
outreg2 using "Table B4", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) ctitle("UNEMP(1)") append
reg unemployed st t fa tfa fasq tfasq s sfa ///
		stfa sfasq stfasq if relate==3 & son==1 & sons >= 1 ///
		& fage>=fage18 & urban == 2, vce(cluster fa)		
outreg2 using "Table B4", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) ctitle("UNEMP(2)") append
reg unemployed st t fa tfa fasq tfasq facb tfacb s sfa ///
		stfa sfasq stfasq sfacb stfacb if relate==3 & son==1 & sons >= 1 ///
		& fage>=fage18 & urban == 2, vce(cluster fa)		
outreg2 using "Table B4", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) ctitle("UNEMP(3)") append
		
		
reg cskill st t fa tfa s sfa ///
		stfa if relate==3 & son==1 & sons >= 1 ///
		& fage>=fage18 & urban == 2, vce(cluster fa)		
outreg2 using "Table B4", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) ctitle("SKILL(1)") append

		reg cskill st t fa tfa fasq tfasq s sfa ///
		stfa sfasq stfasq if relate==3 & son==1 & sons >= 1 ///
		& fage>=fage18 & urban == 2, vce(cluster fa)		
outreg2 using "Table B4", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) ctitle("SKILL(2)") append

reg cskill st t fa tfa fasq tfasq facb tfacb s sfa ///
		stfa sfasq stfasq sfacb stfacb if relate==3 & son==1 & sons >= 1 ///
		& fage>=fage18 & urban == 2, vce(cluster fa)		
outreg2 using "Table B4", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) ctitle("SKILL(3)") append


gen av_w = 9.911167 if job == 1
replace av_w = 9.913689 if job == 2
replace av_w = 9.612678 if job  == 3
replace av_w = 9.527885 if job == 4
replace av_w = 9.141291 if job == 5
replace av_w = 9.256496 if job == 6
replace av_w = 9.238783 if job == 7
replace av_w = 9.377953 if job == 8
replace av_w = 9.288187 if job == 9


reg av_w st t fa tfa s sfa ///
		stfa if relate==3 & son==1 & sons >= 1 ///
		& fage>=fage18 & urban == 2, vce(cluster fa)		
outreg2 using "Table B4", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) ctitle("grossmonthlywage(1)") append
reg av_w st t fa tfa fasq tfasq s sfa ///
		stfa sfasq stfasq if relate==3 & son==1 & sons >= 1 ///
		& fage>=fage18 & urban == 2, vce(cluster fa)		
outreg2 using "Table B4", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) ctitle("grossmonthlywage(2)") append
reg av_w st t fa tfa fasq tfasq facb tfacb s sfa ///
		stfa sfasq stfasq sfacb stfacb if relate==3 & son==1 & sons >= 1 ///
		& fage>=fage18 & urban == 2, vce(cluster fa)		
outreg2 using "Table B4", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) ctitle("grossmonthlywage(3)") append

		


********************************************************************************
*********************************  THE END *************************************
********************************************************************************
	
